<?php

$client = stream_socket_client(
    'tcp://127.0.0.1:8000',
    $errno,
    $errStr,
    1,
    STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT
);

while (true) {
    $res = fwrite($client, 'Hello Server');

    $data = fread($client, 66535);

    var_dump($data . PHP_EOL);

    sleep(5);
}


// fclose($client);